package com.sjm.service;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;

import org.springframework.stereotype.Service;

import com.sjm.model.SubSystemStatus;

@Service
public class SjmService {
	@PersistenceContext
	private EntityManager entityManager;
	public List<SubSystemStatus> findByStatus(String status) {
		TypedQuery<SubSystemStatus> q = entityManager.createQuery(
				"Select s from SubSystemStatus s where s.status=?1",
				SubSystemStatus.class).setParameter(1, status);
           List<SubSystemStatus> result = q.getResultList();
           return result;
	}
}
